import React, { Component } from 'react';
/* ref获取DOM */
class Index extends Component {
    constructor(props){
        super(props);
        this.myRef=React.createRef()
    }
    render() {
        return (
            <div>
                <p ref={this.myRef}>hello world</p>
            </div>
        );
    }
    componentDidMount(){
        console.log(this.myRef.current);
    }
}

export default Index;
